﻿using System;
using System.Text;
using Robot_1;
using FieldNS;

namespace robotNS
{

public class ConsoleKeyExample
{
    public static int FieldHeght = 56;
    public static int FieldWidth = 79; 
    public static int xRobotStartPosition = 10;
    public static int yRobotStartPosition = 10;

    public static void Main()
    {
        Console.WriteLine("Press a key UpArrow, or DownArrow, or LeftArrow, or RightArrow");
    //    Console.WriteLine("12345678901234567890123456789012345678901234567890123456789012345678901234567890");

        Console.WriteLine("Press Esc to exit.");
        Console.WriteLine("\nPress any key for starting");
        Console.ReadKey();
        //---------------
        Field GameFieald = new Field(0, 0, FieldWidth, FieldHeght);
        Robot Kiborg = new Robot();
        Robot Terminator = new Robot();

        Kiborg.DrawRobot();
        Terminator.DrawRobot();
        ConsoleKeyInfo input;
        do
        {           
            input = Console.ReadKey(true);
            if (input.Key.ToString() == "DownArrow"){
                Terminator.GoDown();
            }
            else if (input.Key.ToString() == "UpArrow"){
                Terminator.GoUp();
                }
            else if (input.Key.ToString() == "LeftArrow"){
                Terminator.GoLeft();
            }
            else if (input.Key.ToString() == "RightArrow"){
                Terminator.GoRight();
            }
            else if (input.Key.ToString() == "X")
            {
                Kiborg.GoDown();
            }
            else if (input.Key.ToString() == "W")
            {
                Kiborg.GoUp();
            }
            else if (input.Key.ToString() == "A")
            {
                Kiborg.GoLeft();

            }
            else if (input.Key.ToString() == "D")
            {
                Kiborg.GoRight();
            }
            Kiborg.DrawRobot();
            Terminator.DrawRobot();
        } while (input.Key != ConsoleKey.Escape);
    }
}
}